<%-- 
    Document   : home
    Created on : Nov 6, 2011, 3:40:36 PM
    Author     : Felipe
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin: Home</title>
    </head>
    <body>
        <%
            if (request.getParameter("campo_controle") != null) {
                // processa login
                String name = request.getParameter("usuario");
                String senha1 = request.getParameter("senha1");
                String senha2 = request.getParameter("senha2");
                boolean login_valido = false;
                // metodo valida deve ser implementado
                if (login_valido) {
                    session.setAttribute("access_type", "admin");
                    session.setAttribute("name", name);
                    session.setAttribute("id", 0);
                } else {
                    pageContext.forward("./login.jsp");
                }
                pageContext.forward("./login.jsp");
            }
            // show login form
%>
        <h1>This is the admin's home interface!</h1>
    </body>
</html>
